<?php

namespace backend\models\odm;

use Yii;

/**
 * This is the model class for table "xs_novel".
 *
 * @property string $novel_id
 * @property string $novel_author
 * @property string $novel_title
 * @property string $novel_pinyin
 * @property integer $novel_chapter
 * @property integer $novel_type
 * @property integer $novel_status
 * @property integer $novel_charge_id
 * @property string $novel_op_status
 * @property string $novel_op_time
 * @property integer $novel_main_category
 * @property integer $novel_category
 * @property string $novel_cover
 * @property string $novel_click
 * @property string $novel_today_click
 * @property string $novel_introduction
 * @property string $novel_create_time
 * @property string $novel_update_time
 * @property string $novel_word_total
 * @property string $novel_book_number
 */
class Novel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'xs_novel';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['novel_chapter', 'novel_type', 'novel_status', 'novel_charge_id', 'novel_op_status', 'novel_main_category', 'novel_category', 'novel_click', 'novel_today_click', 'novel_word_total'], 'integer'],
            [['novel_op_time', 'novel_create_time', 'novel_update_time'], 'safe'],
            [['novel_cover'], 'required'],
            [['novel_author', 'novel_book_number'], 'string', 'max' => 100],
            [['novel_title', 'novel_pinyin', 'novel_cover', 'novel_introduction'], 'string', 'max' => 200],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'novel_id' => Yii::t('app', '小说id'),
            'novel_author' => Yii::t('app', '小说作者'),
            'novel_title' => Yii::t('app', '小说标题'),
            'novel_pinyin' => Yii::t('app', '小说拼音'),
            'novel_chapter' => Yii::t('app', '章节数'),
            'novel_type' => Yii::t('app', '小说类型[1:完结,2:连载]'),
            'novel_status' => Yii::t('app', '小说状态[1:正常,2:删除]'),
            'novel_charge_id' => Yii::t('app', '小说收费标准id'),
            'novel_op_status' => Yii::t('app', '上下架状态 1上架0下架'),
            'novel_op_time' => Yii::t('app', '小说上架时间'),
            'novel_main_category' => Yii::t('app', '小说主分类[0:无,1:男频,2:女频]'),
            'novel_category' => Yii::t('app', '小说分类'),
            'novel_cover' => Yii::t('app', '封面'),
            'novel_click' => Yii::t('app', '总点击量'),
            'novel_today_click' => Yii::t('app', '当日点击量'),
            'novel_introduction' => Yii::t('app', '小说简介'),
            'novel_create_time' => Yii::t('app', '创建时间'),
            'novel_update_time' => Yii::t('app', '修改时间'),
            'novel_word_total' => Yii::t('app', '小说字数'),
            'novel_book_number' => Yii::t('app', '小说编号'),
        ];
    }
}
